﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


class sequenceOfMaximalSum
{
    static void Main()
    {
        //            0  1   2  3   4  5  6   7  8
        int[] Arr = { 2, 3, -6, 2, -1, 6, 4, -8, 8 };
        //2, -1, 6, 4
        int lenght = Arr.Length;
        int maxSum = 0;
        int startCount = 0;
        for (int count = 0; count < lenght; count++) 
        {
            int sum = 0;
            for (int count1 = count; count1 < lenght; count1++) 
            {
                sum += Arr[count1];
            }
            if (sum > maxSum) 
            {
                maxSum = sum;
                startCount = count;
            }
        }
    }
}

